package com.wds.stock.stockana.events;

import android.util.Log;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;

/**
 * ---------------------------------------------------
 * Description: 得到所有发票的event
 * Author: ljgsonx
 * Belong to: com.wds.stock.stockana.events
 * Time: 2016/1/15 18:53
 * ---------------------------------------------------
 */
public class GetAllStocksEvent {

    private final String TAG = "GetAllStocksEvent--->";
    private String message;

    public GetAllStocksEvent(String message) {
        this.message = message;
    }

    public String getMessage() {
        return message;
    }

    public JSONArray getAllStocks(){
        try{
            return JSON.parseArray(message);
        }catch (Exception e) {
            Log.e(TAG, "there are some error when casting json string");
            return null;
        }
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
